package com.company.poker.channel;

import akka.actor.ActorRef;
import com.company.poker.protocol.ByteMessage;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;

/**
 * Description of class.
 * Created 4/26/13 8:04 PM
 *
 * @author andrey.rodin@playtech.com
 */

public class CamelProcessor implements Processor {

    private ActorRef end;

    public CamelProcessor(ActorRef end) {
        this.end = end;
    }

    @Override
    public void process(Exchange exchange) throws Exception {
       ByteMessage msg = (ByteMessage) exchange.getIn().getBody();
        end.tell(msg, end);
    }
}
